package cn.bo.cloud.demo1;

import cn.bo.cloud.demo1.annotation.IgnoreScan;
import cn.bo.cloud.demo1.configuration.RibbonConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.cloud.netflix.ribbon.RibbonClients;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
// 配置多个Ribbon不能被@CompentScan扫描到，否则就是全局配置的效果
//@RibbonClients(value = {
        // 在SpringBoot主程序扫描包外定义配置类,或者再扫描包配置忽略
//        @RibbonClient(name = "demo-server-2", configuration = RibbonConfig.class)
//})
// 通过自定义注解忽略扫描某些包
@ComponentScan(excludeFilters = {@ComponentScan.Filter(type = FilterType.ANNOTATION,value = IgnoreScan.class)})
@EnableFeignClients
public class Demo1ServerApplication {


    public static void main(String[] args) {
        SpringApplication.run(Demo1ServerApplication.class, args);
    }


}
